#ifndef printerlibs_caysnpos_h
#define printerlibs_caysnpos_h

#ifndef PRINTERLIBS_API
#define PRINTERLIBS_API
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifndef CallbackFunctionOnNetPrinterDiscovered
#define CallbackFunctionOnNetPrinterDiscovered
typedef void (*on_netprinter_discovered_a)(const char *local_ip, const char *discovered_mac, const char *discovered_ip, const char *discovered_name, const void *private_data);
typedef void (*on_netprinter_discovered_w)(const wchar_t *local_ip, const wchar_t *discovered_mac, const wchar_t *discovered_ip, const wchar_t *discovered_name, const void *private_data);
#endif

#ifndef CallbackFunctionOnBluetoothDeviceDiscovered
#define CallbackFunctionOnBluetoothDeviceDiscovered
typedef void (*on_btdevice_discovered_a)(const char *device_name, const char *device_address, const void *private_data);
#endif

#ifndef CallbackFunctionOnBytesReaded
#define CallbackFunctionOnBytesReaded
typedef void (*on_bytes_readed)(const unsigned char *buffer, const unsigned int count, void *private_data);
#endif

#ifndef CallbackFunctionOnBytesWrited
#define CallbackFunctionOnBytesWrited
typedef void (*on_bytes_writed)(const unsigned char *buffer, const unsigned int count, void *private_data);
#endif

#ifndef CallbackFunctionOnPortClosed
#define CallbackFunctionOnPortClosed
typedef void (*on_port_closed)(void *private_data);
#endif

#ifndef MarcoDefinitionQueryBuffer
#define MarcoDefinitionQueryBuffer
#define PL_QUERYBUFFER_EMTPY 0
#define PL_QUERYBUFFER_FAILED_PORT_CLOSED -1
#define PL_QUERYBUFFER_FAILED_PORT_WRITEFAILED -2
#define PL_QUERYBUFFER_FAILED_PORT_READFAILED -3
#define PL_QUERYBUFFER_NOT_EMPTY -4
#endif

#ifndef MarcoDefinitionPrintResult
#define MarcoDefinitionPrintResult
#define PL_PRINTRESULT_SUCCESS 0
#define PL_PRINTRESULT_PORT_CLOSED -1
#define PL_PRINTRESULT_PORT_WRITEFAILED -2
#define PL_PRINTRESULT_PORT_READFAILED -3
#define PL_PRINTRESULT_PRINTER_OFFLINE -102
#define PL_PRINTRESULT_PRINTER_NOPAPER -103
#define PL_PRINTRESULT_OTHER_RERROR -101
#endif

#ifndef MarcoDefinitionPrinterStatus
#define MarcoDefinitionPrinterStatus
#define PL_PRINTERSTATUS_DRAWER_OPENED(status) (((status >> 0) & 0x04) == 0x00)
#define PL_PRINTERSTATUS_OFFLINE(status) (((status >> 0) & 0x08) == 0x08)
#define PL_PRINTERSTATUS_COVERUP(status) (((status >> 8) & 0x04) == 0x04)
#define PL_PRINTERSTATUS_FEED_PRESSED(status) (((status >> 8) & 0x08) == 0x08)
#define PL_PRINTERSTATUS_NOPAPER(status) (((status >> 8) & 0x20) == 0x20)
#define PL_PRINTERSTATUS_ERROR_OCCURED(status) (((status >> 8) & 0x40) == 0x40)
#define PL_PRINTERSTATUS_CUTTER_ERROR(status) (((status >> 16) & 0x08) == 0x08)
#define PL_PRINTERSTATUS_UNRECOVERABLE_ERROR(status) (((status >> 16) & 0x20) == 0x20)
#define PL_PRINTERSTATUS_DEGREE_OR_VOLTAGE_OVERRANGE(status) (((status >> 16) & 0x40) == 0x40)
#define PL_PRINTERSTATUS_PAPER_NEAREND(status) (((status >> 24) & 0x0C) == 0x0C)
#define PL_PRINTERSTATUS_PAPER_TAKEOUT(status) (((status >> 24) & 0x04) == 0x04)
#endif

#ifndef EnumTypePrintDensity
#define EnumTypePrintDensity
typedef enum PrintDensity { PrintDensity_Light, PrintDensity_Normal, PrintDensity_Dark } PrintDensity;
#endif

#ifndef EnumTypePosAlignment
#define EnumTypePosAlignment
typedef enum PosAlignment { PosAlignment_Left, PosAlignment_HCenter, PosAlignment_Right } PosAlignment;
#endif

#ifndef EnumTypeMultiByteModeEncoding
#define EnumTypeMultiByteModeEncoding
typedef enum MultiByteModeEncoding { MultiByteModeEncoding_GBK = 0, MultiByteModeEncoding_UTF8 = 1, MultiByteModeEncoding_BIG5 = 3, MultiByteModeEncoding_ShiftJIS = 4, MultiByteModeEncoding_EUCKR = 5 } MultiByteModeEncoding;
#endif

#ifndef EnumTypeAsciiTextFontType
#define EnumTypeAsciiTextFontType
typedef enum AsciiTextFontType { AsciiTextFontType_A, AsciiTextFontType_B, AsciiTextFontType_C, AsciiTextFontType_D, AsciiTextFontType_E } AsciiTextFontType;
#endif

#ifndef EnumTypeTextUnderline
#define EnumTypeTextUnderline
typedef enum TextUnderline { TextUnderline_None, TextUnderline_One, TextUnderline_Two } TextUnderline;
#endif

#ifndef EnumTypeCharacterSet
#define EnumTypeCharacterSet
typedef enum CharacterSet {
    CharacterSet_USA = 0,
    CharacterSet_FRANCE = 1,
    CharacterSet_GERMANY = 2,
    CharacterSet_UK = 3,
    CharacterSet_DENMARK_I = 4,
    CharacterSet_SWEDEN = 5,
    CharacterSet_ITALY = 6,
    CharacterSet_SPAIN_I = 7,
    CharacterSet_JAPAN = 8,
    CharacterSet_NORWAY = 9,
    CharacterSet_DENMARK_II = 10,
    CharacterSet_SPAIN_II = 11,
    CharacterSet_LATIN = 12,
    CharacterSet_KOREA = 13,
    CharacterSet_SLOVENIA = 14,
    CharacterSet_CHINA = 15
} CharacterSet;
#endif

#ifndef EnumTypeCharacterCodepage
#define EnumTypeCharacterCodepage
typedef enum CharacterCodepage {
    CharacterCodepage_CP437 = 0,
    CharacterCodepage_KATAKANA = 1,
    CharacterCodepage_CP850 = 2,
    CharacterCodepage_CP860 = 3,
    CharacterCodepage_CP863 = 4,
    CharacterCodepage_CP865 = 5,
    CharacterCodepage_WCP1251 = 6,
    CharacterCodepage_CP866 = 7,
    CharacterCodepage_MIK = 8,
    CharacterCodepage_CP755 = 9,
    CharacterCodepage_IRAN = 10,
    CharacterCodepage_CP862 = 15,
    CharacterCodepage_WCP1252 = 16,
    CharacterCodepage_WCP1253 = 17,
    CharacterCodepage_CP852 = 18,
    CharacterCodepage_CP858 = 19,
    CharacterCodepage_IRAN_II = 20,
    CharacterCodepage_LATVIAN = 21,
    CharacterCodepage_CP864 = 22,
    CharacterCodepage_ISO_8859_1 = 23,
    CharacterCodepage_CP737 = 24,
    CharacterCodepage_WCP1257 = 25,
    CharacterCodepage_THAI = 26,
    CharacterCodepage_CP720 = 27,
    CharacterCodepage_CP855 = 28,
    CharacterCodepage_CP857 = 29,
    CharacterCodepage_WCP1250 = 30,
    CharacterCodepage_CP775 = 31,
    CharacterCodepage_WCP1254 = 32,
    CharacterCodepage_WCP1255 = 33,
    CharacterCodepage_WCP1256 = 34,
    CharacterCodepage_WCP1258 = 35,
    CharacterCodepage_ISO_8859_2 = 36,
    CharacterCodepage_ISO_8859_3 = 37,
    CharacterCodepage_ISO_8859_4 = 38,
    CharacterCodepage_ISO_8859_5 = 39,
    CharacterCodepage_ISO_8859_6 = 40,
    CharacterCodepage_ISO_8859_7 = 41,
    CharacterCodepage_ISO_8859_8 = 42,
    CharacterCodepage_ISO_8859_9 = 43,
    CharacterCodepage_ISO_8859_15 = 44,
    CharacterCodepage_THAI_2 = 45,
    CharacterCodepage_CP856 = 46,
    CharacterCodepage_CP874 = 47,
    CharacterCodepage_TCVN3 = 48
} CharacterCodepage;
#endif

#ifndef EnumTypeBarcodeReadableTextFontType
#define EnumTypeBarcodeReadableTextFontType
typedef enum BarcodeReadableTextFontType { BarcodeReadableTextFontType_Standard, BarcodeReadableTextFontType_Small } BarcodeReadableTextFontType;
#endif

#ifndef EnumTypeBarcodeReadableTextPosition
#define EnumTypeBarcodeReadableTextPosition
typedef enum BarcodeReadableTextPosition { BarcodeReadableTextPosition_None, BarcodeReadableTextPosition_AboveBarcode, BarcodeReadableTextPosition_BelowBarcode, BarcodeReadableTextPosition_AboveAndBelowBarcode } BarcodeReadableTextPosition;
#endif

#ifndef EnumTypePosBarcodeType
#define EnumTypePosBarcodeType
typedef enum PosBarcodeType { 
    PosBarcodeType_UPCA = 0x41,
    PosBarcodeType_UPCE = 0x42,
    PosBarcodeType_EAN13 = 0x43,
    PosBarcodeType_EAN8 = 0x44,
    PosBarcodeType_CODE39 = 0x45,
    PosBarcodeType_ITF = 0x46,
    PosBarcodeType_CODEBAR = 0x47,
    PosBarcodeType_CODE93 = 0x48,
    PosBarcodeType_CODE128 = 0x49
} PosBarcodeType;
#endif

#ifndef EnumTypeQRCodeECC
#define EnumTypeQRCodeECC
typedef enum QRCodeECC { QRCodeECC_L = 1, QRCodeECC_M = 2, QRCodeECC_Q = 3, QRCodeECC_H = 4 } QRCodeECC;
#endif

#ifndef EnumTypeImagePixelsFormat
#define EnumTypeImagePixelsFormat
typedef enum ImagePixelsFormat { 
    ImagePixelsFormat_MONO = 1,
    ImagePixelsFormat_MONOLSB = 2,
    ImagePixelsFormat_GRAY8 = 3,
    ImagePixelsFormat_BYTEORDERED_RGB24 = 4,
    ImagePixelsFormat_BYTEORDERED_BGR24 = 5,
    ImagePixelsFormat_BYTEORDERED_ARGB32 = 6,
    ImagePixelsFormat_BYTEORDERED_RGBA32 = 7,
    ImagePixelsFormat_BYTEORDERED_ABGR32 = 8,
    ImagePixelsFormat_BYTEORDERED_BGRA32 = 9
} ImagePixelsFormat;
#endif

#ifndef EnumTypeImageBinarizationMethod
#define EnumTypeImageBinarizationMethod
typedef enum ImageBinarizationMethod { ImageBinarizationMethod_Dithering, ImageBinarizationMethod_Thresholding } ImageBinarizationMethod;
#endif

#ifndef EnumTypeImageCompressionMethod
#define EnumTypeImageCompressionMethod
typedef enum ImageCompressionMethod { ImageCompressionMethod_None, ImageCompressionMethod_Level1, ImageCompressionMethod_Level2 } ImageCompressionMethod;
#endif

PRINTERLIBS_API const char *CaysnPos_LibraryVersion(void);

PRINTERLIBS_API void CaysnPos_EnumNetPrinterA(unsigned int timeout, int *cancel, on_netprinter_discovered_a on_discovered, const void *private_data);
PRINTERLIBS_API void CaysnPos_EnumNetPrinterW(unsigned int timeout, int *cancel, on_netprinter_discovered_w on_discovered, const void *private_data);

PRINTERLIBS_API void CaysnPos_EnumBleDeviceA(unsigned int timeout, int *cancel, on_btdevice_discovered_a on_discovered, const void *private_data);

PRINTERLIBS_API void * CaysnPos_OpenTcpA(const char *ip, unsigned short port, unsigned int timeout);
PRINTERLIBS_API void * CaysnPos_OpenTcpW(const wchar_t *ip, unsigned short port, unsigned int timeout);

PRINTERLIBS_API void * CaysnPos_OpenTcpBindInterfaceA(const char *ip, unsigned short port, const char *bind_local_addr, unsigned int timeout);
PRINTERLIBS_API void * CaysnPos_OpenTcpBindInterfaceW(const wchar_t *ip, unsigned short port, const wchar_t *bind_local_addr, unsigned int timeout);

PRINTERLIBS_API void * CaysnPos_OpenBT4ByConnectA(const char *address);
PRINTERLIBS_API void * CaysnPos_OpenBT4ByConnectW(const wchar_t *address);

PRINTERLIBS_API void * CaysnPos_OpenBT4ByConnectPeripheral(void *mPeripheral);

PRINTERLIBS_API void CaysnPos_SetBT4WriteMode(void * handle, bool bHighSpeed, unsigned int nPacketSize, unsigned int nPacketTimeout, unsigned int nPacketMaxRetry);

PRINTERLIBS_API void * CaysnPos_OpenFileNewA(const char *name);
PRINTERLIBS_API void * CaysnPos_OpenFileNewW(const wchar_t *name);

PRINTERLIBS_API void * CaysnPos_OpenFileAppendA(const char *name);
PRINTERLIBS_API void * CaysnPos_OpenFileAppendW(const wchar_t *name);

PRINTERLIBS_API void * CaysnPos_OpenMemory(unsigned int nMemorySpaceSize);

PRINTERLIBS_API const unsigned char *CaysnPos_MemoryData(void * handle);

PRINTERLIBS_API unsigned int CaysnPos_MemoryDataLength(void * handle);

PRINTERLIBS_API void CaysnPos_ClearMemoryData(void * handle);

PRINTERLIBS_API int CaysnPos_SetWritedEvent(void * handle, const on_bytes_writed event, void *private_data);

PRINTERLIBS_API int CaysnPos_SetReadedEvent(void * handle, const on_bytes_readed event, void *private_data);

PRINTERLIBS_API int CaysnPos_SetClosedEvent(void * handle, const on_port_closed event, void *private_data);

PRINTERLIBS_API int CaysnPos_Write(void * handle, const unsigned char *buffer, unsigned int count, unsigned int timeout);

PRINTERLIBS_API int CaysnPos_Read(void * handle, unsigned char *buffer, unsigned int count, unsigned int timeout);

PRINTERLIBS_API int CaysnPos_ReadUntilByte(void * handle, unsigned char *buffer, unsigned int count, unsigned int timeout, unsigned char breakByte);

PRINTERLIBS_API void CaysnPos_SkipAvailable(void * handle);

PRINTERLIBS_API void CaysnPos_Close(void * handle);

PRINTERLIBS_API int CaysnPos_QueryPrinterBufferEmpty(void * handle, unsigned int timeout);

PRINTERLIBS_API int CaysnPos_QueryPrinterStatus(void * handle, unsigned int timeout);

PRINTERLIBS_API int CaysnPos_QueryPrintResult(void * handle, unsigned int timeout);

PRINTERLIBS_API int CaysnPos_KickOutDrawer(void * handle, int nDrawerIndex, int nHighLevelTime, int nLowLevelTime);

PRINTERLIBS_API int CaysnPos_Beep(void * handle, int nBeepCount, int nBeepMs);

PRINTERLIBS_API int CaysnPos_FeedAndHalfCutPaper(void * handle);

PRINTERLIBS_API int CaysnPos_FullCutPaper(void * handle);

PRINTERLIBS_API int CaysnPos_HalfCutPaper(void * handle);

PRINTERLIBS_API int CaysnPos_ResetPrinter(void * handle);

PRINTERLIBS_API int CaysnPos_SetPrinter(void * handle, int setType, const void *buffer, unsigned int count);

PRINTERLIBS_API int CaysnPos_SetPrintSpeed(void * handle, int nSpeed);

PRINTERLIBS_API int CaysnPos_SetPrintDensity(void * handle, PrintDensity nDensity);

PRINTERLIBS_API int CaysnPos_SetPrintHeatPara(void * handle, int nMaxHeatDots, int nHeatOnTime, int nHeatOffTime);

PRINTERLIBS_API int CaysnPos_PrintSelfTestPage(void * handle);

PRINTERLIBS_API int CaysnPos_SetMovementUnit(void * handle, int nHorizontalMovementUnit, int nVerticalMovementUnit);

PRINTERLIBS_API int CaysnPos_SetPrintAreaLeftMargin(void * handle, int nLeftMargin);

PRINTERLIBS_API int CaysnPos_SetPrintAreaWidth(void * handle, int nWidth);

PRINTERLIBS_API int CaysnPos_SetHorizontalAbsolutePrintPosition(void * handle, int nPosition);

PRINTERLIBS_API int CaysnPos_SetHorizontalRelativePrintPosition(void * handle, int nPosition);

PRINTERLIBS_API int CaysnPos_SetAlignment(void * handle, PosAlignment nAlignment);

PRINTERLIBS_API int CaysnPos_FeedLine(void * handle, int numLines);

PRINTERLIBS_API int CaysnPos_FeedDot(void * handle, int numDots);

PRINTERLIBS_API int CaysnPos_PrintTextA(void * handle, const char *str);

PRINTERLIBS_API int CaysnPos_PrintTextInUTF8W(void * handle, const wchar_t *str);

PRINTERLIBS_API int CaysnPos_PrintTextInGBKW(void * handle, const wchar_t *str);

PRINTERLIBS_API int CaysnPos_PrintTextInBIG5W(void * handle, const wchar_t *str);

PRINTERLIBS_API int CaysnPos_PrintTextInShiftJISW(void * handle, const wchar_t *str);

PRINTERLIBS_API int CaysnPos_PrintTextInEUCKRW(void * handle, const wchar_t *str);

PRINTERLIBS_API int CaysnPos_SetTextScale(void * handle, int nWidthScale, int nHeightScale);

PRINTERLIBS_API int CaysnPos_SetAsciiTextFontType(void * handle, AsciiTextFontType nFontType);

PRINTERLIBS_API int CaysnPos_SetTextBold(void * handle, int nBold);

PRINTERLIBS_API int CaysnPos_SetTextUnderline(void * handle, TextUnderline nUnderline);

PRINTERLIBS_API int CaysnPos_SetTextUpsideDown(void * handle, int nUpsideDown);

PRINTERLIBS_API int CaysnPos_SetTextWhiteOnBlack(void * handle, int nWhiteOnBlack);

PRINTERLIBS_API int CaysnPos_SetTextRotate(void * handle, int nRotate);

PRINTERLIBS_API int CaysnPos_SetTextLineHeight(void * handle, int nLineHeight);

PRINTERLIBS_API int CaysnPos_SetAsciiTextCharRightSpacing(void * handle, int nSpacing);

PRINTERLIBS_API int CaysnPos_SetKanjiTextCharSpacing(void * handle, int nLeftSpacing, int nRightSpacing);

PRINTERLIBS_API int CaysnPos_SetSingleByteMode(void * handle);

PRINTERLIBS_API int CaysnPos_SetCharacterSet(void * handle, CharacterSet nCharacterSet);

PRINTERLIBS_API int CaysnPos_SetCharacterCodepage(void * handle, CharacterCodepage nCharacterCodepage);

PRINTERLIBS_API int CaysnPos_SetMultiByteMode(void * handle);

PRINTERLIBS_API int CaysnPos_SetMultiByteEncoding(void * handle, MultiByteModeEncoding nEncoding);

PRINTERLIBS_API int CaysnPos_SetUserCharacterPatternFromFileA(void * handle, char ch, const char *pszFile);
PRINTERLIBS_API int CaysnPos_SetUserCharacterPatternFromFileW(void * handle, char ch, const wchar_t *pszFile);

PRINTERLIBS_API int CaysnPos_SetUserCharacterPatternFromData(void * handle, char ch, const unsigned char *data, unsigned int data_size);

PRINTERLIBS_API int CaysnPos_SetUserCharacterPatternFromPixels(void * handle, char ch, const unsigned char *img_data, unsigned int img_datalen, int img_width, int img_height, int img_stride, ImagePixelsFormat img_format);

PRINTERLIBS_API int CaysnPos_ClearUserCharacterPattern(void * handle, char ch);

PRINTERLIBS_API int CaysnPos_SetUserCharacterEnable(void * handle, int enable);

PRINTERLIBS_API int CaysnPos_SetUserKanjiPatternFromFileA(void * handle, unsigned char c1, unsigned char c2, const char *pszFile);
PRINTERLIBS_API int CaysnPos_SetUserKanjiPatternFromFileW(void * handle, unsigned char c1, unsigned char c2, const wchar_t *pszFile);

PRINTERLIBS_API int CaysnPos_SetUserKanjiPatternFromData(void * handle, unsigned char c1, unsigned char c2, const unsigned char *data, unsigned int data_size);

PRINTERLIBS_API int CaysnPos_SetUserKanjiPatternFromPixels(void * handle, unsigned char c1, unsigned char c2, const unsigned char *img_data, unsigned int img_datalen, int img_width, int img_height, int img_stride, ImagePixelsFormat img_format);

PRINTERLIBS_API int CaysnPos_PrintBarcodeA(void * handle, PosBarcodeType nBarcodeType, const char *str);
PRINTERLIBS_API int CaysnPos_PrintBarcodeW(void * handle, PosBarcodeType nBarcodeType, const wchar_t *str);

PRINTERLIBS_API int CaysnPos_SetBarcodeUnitWidth(void * handle, int nBarcodeUnitWidth);

PRINTERLIBS_API int CaysnPos_SetBarcodeHeight(void * handle, int nBarcodeHeight);

PRINTERLIBS_API int CaysnPos_SetBarcodeReadableTextFontType(void * handle, BarcodeReadableTextFontType nFontType);

PRINTERLIBS_API int CaysnPos_SetBarcodeReadableTextPosition(void * handle, BarcodeReadableTextPosition nTextPosition);

PRINTERLIBS_API int CaysnPos_PrintQRCodeA(void * handle, int nVersion, QRCodeECC nECCLevel, const char *str);
PRINTERLIBS_API int CaysnPos_PrintQRCodeW(void * handle, int nVersion, QRCodeECC nECCLevel, const wchar_t *str);

PRINTERLIBS_API int CaysnPos_PrintQRCodeUseEpsonCmdA(void * handle, int nQRCodeUnitWidth, QRCodeECC nECCLevel, const char *str);
PRINTERLIBS_API int CaysnPos_PrintQRCodeUseEpsonCmdW(void * handle, int nQRCodeUnitWidth, QRCodeECC nECCLevel, const wchar_t *str);

PRINTERLIBS_API int CaysnPos_PrintDoubleQRCodeA(void * handle, int nQRCodeUnitWidth, int nQR1Position, int nQR1Version, QRCodeECC nQR1ECCLevel, const char *strQR1, int nQR2Position, int nQR2Version, QRCodeECC nQR2ECCLevel, const char *strQR2);
PRINTERLIBS_API int CaysnPos_PrintDoubleQRCodeW(void * handle, int nQRCodeUnitWidth, int nQR1Position, int nQR1Version, QRCodeECC nQR1ECCLevel, const wchar_t *strQR1, int nQR2Position, int nQR2Version, QRCodeECC nQR2ECCLevel, const wchar_t *strQR2);

PRINTERLIBS_API int CaysnPos_PrintPDF417BarcodeUseEpsonCmdA(void * handle, int columnCount, int rowCount, int unitWidth, int rowHeight, int nECCLevel, int dataProcessingMode, const char *str);
PRINTERLIBS_API int CaysnPos_PrintPDF417BarcodeUseEpsonCmdW(void * handle, int columnCount, int rowCount, int unitWidth, int rowHeight, int nECCLevel, int dataProcessingMode, const wchar_t *str);

PRINTERLIBS_API int CaysnPos_GetImageSizeFromFileA(const char *pszFile, int *depth, int *width, int *height);
PRINTERLIBS_API int CaysnPos_GetImageSizeFromFileW(const wchar_t *pszFile, int *depth, int *width, int *height);

PRINTERLIBS_API int CaysnPos_GetImageSizeFromData(const unsigned char *data, unsigned int data_size, int *depth, int *width, int *height);

PRINTERLIBS_API int CaysnPos_PrintRasterImageFromFileA(void * handle, int dstw, int dsth, const char *pszFile, ImageBinarizationMethod binaryzation_method);
PRINTERLIBS_API int CaysnPos_PrintRasterImageFromFileW(void * handle, int dstw, int dsth, const wchar_t *pszFile, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_PrintRasterImageFromData(void * handle, int dstw, int dsth, const unsigned char *data, unsigned int data_size, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_PrintRasterImageFromPixels(void * handle, const unsigned char *img_data, unsigned int img_datalen, int img_width, int img_height, int img_stride, ImagePixelsFormat img_format, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_PrintRasterImageWithCompressFromFileA(void * handle, int dstw, int dsth, const char *pszFile, ImageBinarizationMethod binaryzation_method, ImageCompressionMethod compress_method);
PRINTERLIBS_API int CaysnPos_PrintRasterImageWithCompressFromFileW(void * handle, int dstw, int dsth, const wchar_t *pszFile, ImageBinarizationMethod binaryzation_method, ImageCompressionMethod compress_method);

PRINTERLIBS_API int CaysnPos_PrintRasterImageWithCompressFromData(void * handle, int dstw, int dsth, const unsigned char *data, unsigned int data_size, ImageBinarizationMethod binaryzation_method, ImageCompressionMethod compress_method);

PRINTERLIBS_API int CaysnPos_PrintRasterImageWithCompressFromPixels(void * handle, const unsigned char *img_data, unsigned int img_datalen, int img_width, int img_height, int img_stride, ImagePixelsFormat img_format, ImageBinarizationMethod binaryzation_method, ImageCompressionMethod compress_method);

PRINTERLIBS_API int CaysnPos_FillDotImageToCurrentLineFromFileA(void * handle, const char *pszFile, ImageBinarizationMethod binaryzation_method);
PRINTERLIBS_API int CaysnPos_FillDotImageToCurrentLineFromFileW(void * handle, const wchar_t *pszFile, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_FillDotImageToCurrentLineFromData(void * handle, const unsigned char *data, unsigned int data_size, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_FillDotImageToCurrentLineFromPixels(void * handle, const unsigned char *img_data, unsigned int img_datalen, int img_width, int img_height, int img_stride, ImagePixelsFormat img_format, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_PrintDotImageSpecifyHorizontalPositionFromFileA(void * handle, int nPosition, int dstw, int dsth, const char *pszFile, ImageBinarizationMethod binaryzation_method);
PRINTERLIBS_API int CaysnPos_PrintDotImageSpecifyHorizontalPositionFromFileW(void * handle, int nPosition, int dstw, int dsth, const wchar_t *pszFile, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_PrintDotImageSpecifyHorizontalPositionFromData(void * handle, int nPosition, int dstw, int dsth, const unsigned char *data, unsigned int data_size, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_PrintDotImageSpecifyHorizontalPositionFromPixels(void * handle, int nPosition, const unsigned char *img_data, unsigned int img_datalen, int img_width, int img_height, int img_stride, ImagePixelsFormat img_format, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_SetNVImageFromFilesA(void * handle, unsigned int count, const char **pszFiles);
PRINTERLIBS_API int CaysnPos_SetNVImageFromFilesW(void * handle, unsigned int count, const wchar_t **pszFiles);

PRINTERLIBS_API int CaysnPos_SetNVImageFromDatas(void * handle, unsigned int count, unsigned char **pdata, unsigned int *pdata_size);

PRINTERLIBS_API int CaysnPos_PrintNVImage(void * handle, int no);

PRINTERLIBS_API int CaysnPos_ClearNVImage(void * handle);

PRINTERLIBS_API int CaysnPos_SetRAMImageFromFileA(void * handle, int dstw, int dsth, const char *pszFile, ImageBinarizationMethod binaryzation_method);
PRINTERLIBS_API int CaysnPos_SetRAMImageFromFileW(void * handle, int dstw, int dsth, const wchar_t *pszFile, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_SetRAMImageFromData(void * handle, int dstw, int dsth, const unsigned char *data, unsigned int data_size, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_SetRAMImageFromPixels(void * handle, const unsigned char *img_data, unsigned int img_datalen, int img_width, int img_height, int img_stride, ImagePixelsFormat img_format, ImageBinarizationMethod binaryzation_method);

PRINTERLIBS_API int CaysnPos_PrintRAMImage(void * handle);

PRINTERLIBS_API int CaysnPos_PrintHorizontalLine(void * handle, int nLineStartPosition, int nLineEndPosition);

PRINTERLIBS_API int CaysnPos_PrintHorizontalLineSpecifyThickness(void * handle, int nLineStartPosition, int nLineEndPosition, int nLineThickness);

PRINTERLIBS_API int CaysnPos_PrintMultipleHorizontalLinesAtOneRow(void * handle, int nLineCount, int *pLineStartPosition, int *pLineEndPosition);

PRINTERLIBS_API int CaysnPos_EnableBlackMarkMode(void * handle);

PRINTERLIBS_API int CaysnPos_DisableBlackMarkMode(void * handle);

PRINTERLIBS_API int CaysnPos_SetBlackMarkMaxFindLength(void * handle, int maxFindLength);

PRINTERLIBS_API int CaysnPos_FindBlackMark(void * handle);

PRINTERLIBS_API int CaysnPos_SetBlackMarkPaperPrintPosition(void * handle, int position);

PRINTERLIBS_API int CaysnPos_SetBlackMarkPaperCutPosition(void * handle, int position);

PRINTERLIBS_API int CaysnPos_FullCutBlackMarkPaper(void * handle);

PRINTERLIBS_API int CaysnPos_HalfCutBlackMarkPaper(void * handle);

#ifdef __cplusplus
}
#endif

#endif

